# 写程序，输入一个整数, 打印如下的四个三角形
# 如:
#     请输入: 3
# 1. 打印
#     *
#     **
#     ***
# 2. 打印
#       *
#      **
#     ***
# 3. 打印
#     ***
#     **
#     *
# 4. 打印
#     ***
#      **
#       *

n = int(input('请输入： '))
# 1. 打印
#     *
#     **
#     ***
print('----- 1. ------')
for line in range(1, n + 1):   # line 行
    print('*' * line)

# 2. 打印
#       *
#      **
#     ***
print('----- 2. ------')
fmt = "%" + str(n) + 's'   # fmt = "%%%ds" % n
print(fmt)
for line in range(1, n + 1):
    starts = '*' * line
    print(fmt % starts)
# 原始方法
# for line in range(1, n + 1):
#     blanks  = ' ' * (n - line)   # 计算空格
#     starts = '*' * line
#     print(blanks + starts)

# 3. 打印
#     ***
#     **
#     *
print('----- 3. ------')
for star_count in range(n, 0, -1):
    print('*' * star_count)

# 4. 打印
#     ***
#      **
#       *
print('----- 4. ------')
for star_count in range(n, 0, -1):
    blanks = ' ' * (n - star_count)
    starts = '*' * star_count
    print(blanks + starts)